package controller;

import bean.User;

public interface Error {
    /**
     * 初始只能接收get方法参数
     * @param username
     * @return
     */
    public String get(String username);

    /**
     *     xml配置加入文件解析器即可接收form表单格式参数
     *     <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
     *         <property name="defaultEncoding" value="UTF-8"></property>
     *         <property name="maxUploadSize" value="2000000"/>
     *     </bean>
     * @param username
     * @return
     */
    public String form(String username);

    /**
     *      导入jackson-databind依赖即可接收json参数，需要加@RequestBody
     *      1.字符串=整个json
     * @param username
     * @return
     */
    public String json1(String username);
    /**
     *      导入jackson-databind依赖即可接收json参数，需要加@RequestBody
     *      2.参数赋给普通对象属性
     * @param User {"username": "deng","password": "7112"}
     * @return
     */
    public String json2(User u);
}
